import { onBeforeUnmount, onMounted, shallowRef } from "vue";
export default function () {
  const chart = shallowRef(null);
  // 刷新 echart
  const chartResizeHandler = () => {
    if (chart.value) {
      chart.value.resize();
    }
  };

  onMounted(() => {
    window.addEventListener("resize", chartResizeHandler);
  });
  return {
    chart,
  };
}
